package o;

import android.content.Context;
import android.content.pm.FeatureInfo;
import android.os.Build;
import android.os.Build.VERSION;
import android.os.LocaleList;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;

public class cge {
    private static String ˎ = null;

    cge() {
    }

    public static int ˊ(@NonNull Context context) {
        return context.getResources().getConfiguration().densityDpi;
    }

    @NonNull
    public static List<String> ˋ(@NonNull Context context) {
        List<String> arrayList = new ArrayList();
        if (VERSION.SDK_INT >= 24) {
            LocaleList locales = context.getResources().getConfiguration().getLocales();
            for (int i = 0; i < locales.size(); i++) {
                CharSequence language = locales.get(i).getLanguage();
                if (!(TextUtils.isEmpty(language) || arrayList.contains(language))) {
                    arrayList.add(language);
                }
            }
        } else {
            arrayList.add(context.getResources().getConfiguration().locale.getLanguage());
        }
        return arrayList;
    }

    static boolean ˋ(@NonNull String str, @NonNull String[] strArr) {
        for (String equals : strArr) {
            if (equals.equals(str)) {
                return true;
            }
        }
        return false;
    }

    static boolean ॱ(@NonNull String str, @NonNull String[] strArr) {
        int i = 0;
        int i2 = 0;
        int i3 = 0;
        for (String str2 : strArr) {
            if (str2.startsWith("config.")) {
                i3 = 1;
            } else if (!str2.contains(".config.")) {
                i2++;
            }
            if (str2.endsWith("config." + str)) {
                i++;
            }
        }
        if (i2 + i3 == i) {
            return true;
        }
        return false;
    }

    @NonNull
    public static List<String> ˏ(@NonNull Set<String> set, @NonNull String[] strArr) {
        List<String> arrayList = new ArrayList();
        for (String str : set) {
            if (!ˋ(str, strArr)) {
                arrayList.add(str);
            }
        }
        return arrayList;
    }

    @NonNull
    public static List<String> ˏ(@NonNull List<String> list, @NonNull String[] strArr) {
        List<String> arrayList = new ArrayList();
        for (String str : list) {
            if (!ॱ(str, strArr)) {
                arrayList.add(str);
            }
        }
        return arrayList;
    }

    @NonNull
    public static String[] ˋ() {
        if (VERSION.SDK_INT >= 21) {
            return bkz.ˎ(Build.SUPPORTED_ABIS);
        }
        return new String[]{Build.CPU_ABI};
    }

    public static String ˎ(@NonNull Context context) {
        if (ˎ == null) {
            ˎ = bks.ˏ(ˏ(context), ",");
        }
        return ˎ;
    }

    @NonNull
    private static List<String> ˏ(@NonNull Context context) {
        List<String> arrayList = new ArrayList();
        FeatureInfo[] systemAvailableFeatures = context.getPackageManager().getSystemAvailableFeatures();
        if (systemAvailableFeatures != null) {
            for (FeatureInfo featureInfo : systemAvailableFeatures) {
                if (featureInfo.name != null) {
                    arrayList.add(cgc.ˏ(featureInfo.name));
                }
            }
        }
        return arrayList;
    }
}
